#include <iostream>
#include "Bank_t.h"
#include "Account_t.h"
using namespace std;

int main() {

	Bank_t& b1 = Bank_t::getBank();
	Bank_t& b2 = Bank_t::getBank();

	cout << "Initiated Bank1 , please choose your action:" << endl;

	int percent, date, period;

	while(1) {
		cout <<
			"\n| createRegular | createFamily | createStock | notifyBonus | notifyInvest | notifyYear | q: ";

		char c;
		cin >> c;

		if(c!='B' && c!='Y' && c!='I' && c!='F' && c!='S' && c!='R' && c!='q') {
				cout << "No such command. Try again (q to exit)." << endl;
				continue;
		}

		if (c == 'q') {
			break;
		}

		switch (c) {
		case 'Y' :  
			b1.Notify3YearAccounts();
			break;

		case 'B' :  
			b1.NotifyFamilyAccounts();
			break;

		case 'I' :
			b1.NotifyStockAccounts();
			break;

		case 'R' :  
			cout << "Please enter a percent, date(year) and period(3, 7 or 10):"  << endl;
			cin >> percent >> date >> period;
			new Account_t(&b1, Regular_e, percent, date, period);
			
			break;

		case 'F' :  
			cout << "Please enter a percent, date(year) and period(3, 7 or 10):"  << endl;
			cin >> percent >> date >> period;
			new Account_t(&b1, Family_e, percent, date, period);

			break;

		case 'S' :
			cout << "Please enter a percent, date(year) and period(3, 7 or 10):"  << endl;
			cin >> percent >> date >> period;
			new Account_t(&b1, Stock_e, percent, date, period);

			break;
		}
	}

	return 0;
}
